﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApplication1.domain
{
    public class Student
    {
        private int id;
        private string name;
        private string no;
        private string className;
        private int dormitory_id;
        private DormitoryInfo dormitoryInfo;

        public int Id { get => id; set => id = value; }
        public string Name { get => name; set => name = value; }
        public string No { get => no; set => no = value; }
        public string ClassName { get => className; set => className = value; }
        public int Dormitory_id { get => dormitory_id; set => dormitory_id = value; }
        public DormitoryInfo DormitoryInfo { get => dormitoryInfo; set => dormitoryInfo = value; }

        public Student(string name, string no, string class_name, int dormitory_id)
        {
            this.Name = name ?? throw new ArgumentNullException(nameof(name));
            this.No = no ?? throw new ArgumentNullException(nameof(no));
            this.ClassName = class_name ?? throw new ArgumentNullException(nameof(class_name));
            this.Dormitory_id = dormitory_id;
        }

        public Student()
        {
        }
        public string getNo()
        {
            return No;
        }
        public string getName()
        {
            return Name;

        }
        public string getClassName()
        {
            return ClassName;
        }
        public int getDormitoryId()
        {
            return Dormitory_id;

        }
        
        override
        public String ToString() {
            return Name;
        }
        public void setName(string nameInput){
            name = nameInput;
        }
    }
}